Skip to content

Feat: 알림 조회 API 연동#26

Open
alswlekk wants to merge 1 commit intodevelopfrom
feat/show-notification-api-#17
Open

Feat: 알림 조회 API 연동#26
alswlekk wants to merge 1 commit intodevelopfrom
feat/show-notification-api-#17

Conversation

@alswlekk
Copy link
Copy Markdown
Contributor

@alswlekk alswlekk commented Mar 25, 2026

🔗 관련 이슈

📙 작업 설명

  • 알림 조회 화면에서 뜰 알림들 목록을 서버로부터 받아와 알림 조회 화면에 뜨도록 합니다.

📸 스크린샷 또는 시연 영상 (선택)

기능 미리보기 기능 미리보기
기능 설명 기능 설명

💬 추가 설명 or 리뷰 포인트 (선택)

  • 서버로부터 알림들을 받아올 때 페이지별로 알림을 40개씩 받아오는데, 모든 페이지를 한 번에 보내주는지, 한 페이지만 보내주는 지 명시가 안돼 있어서 일단 모든 페이지를 받아온다는 가정하에 코드를 작성했습니다. (만약 특정 페이지 번호를 post로 보내서 받아오는 형태면 한페이지만 받아온다는 가정하에 작성을 할텐데 어떤 페이지의 알림들을 받아오는지 서버에 보내는 부분이 없더라고요)
  • 이는 추후에 서버한테 한 번 물어보고 수정이 필요할 경우 수정하도록 하겠습니다

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 알림 화면에서 서버로부터 실시간 알림 목록을 조회하는 기능 추가
    • 알림의 제목, 내용, 읽음 상태, 생성 날짜 정보 표시
    • 페이지네이션을 지원하여 대량의 알림을 효율적으로 로드
    • 알림 조회 실패 시 사용자에게 오류 메시지 안내

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

둘러보기

알림 조회 API를 백엔드와 연동하는 기능이 추가되었습니다. 새로운 DTO, 레포지토리, 뷰모델을 통해 API에서 페이지네이션된 알림 목록을 조회하고, AlarmScreen에서 동적으로 렌더링하는 전체 스택이 구현되었습니다.

변경 사항

Cohort / File(s) 요약
API 통합
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/fcm/NotificationService.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/di/ApiModule.kt
새로운 getNotifications() 엔드포인트 추가 및 Koin DI에 NotificationService 싱글톤 등록
데이터 모델
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/dto/response/NotificationPageResponseDto.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/dto/response/NotificationResponseDto.kt
페이지네이션 메타데이터와 알림 목록을 담는 두 개의 새로운 DTO 클래스 추가
레포지토리 계층
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/NotificationRepository.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/NotificationRepositoryImpl.kt
알림 조회 인터페이스 메서드 정의 및 구현체에서 API 호출 처리
UI 계층
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmUiState.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmViewModel.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt
상태 관리, 뷰모델 추가 및 AlarmScreen이 하드코딩된 데이터 대신 동적 알림 목록 표시

시퀀스 다이어그램

sequenceDiagram
    participant UI as AlarmScreen
    participant VM as AlarmViewModel
    participant Repo as NotificationRepository
    participant Svc as NotificationService
    participant API as Backend API

    UI->>VM: 초기화 (init)
    VM->>VM: loadAlarms() 호출
    VM->>Repo: getNotifications()
    Repo->>Svc: getNotifications()
    Svc->>API: GET /notifications
    API-->>Svc: Response<List<NotificationPageResponseDto>>
    Svc-->>Repo: 응답 반환
    Repo->>Repo: handleResponse() + runCatching
    Repo-->>VM: Result<List<NotificationPageResponseDto>>
    
    alt 성공
        VM->>VM: uiState 업데이트 (alarmPages)
    else 실패
        VM->>VM: uiState 업데이트 (errorMessage)
    end
    
    VM-->>UI: uiState Flow 구독
    UI->>UI: alarmPages 반복 렌더링
Loading

예상 코드 리뷰 난이도

🎯 3 (보통) | ⏱️ ~20분

제안 리뷰어

  • librawish808

🔔 API 호출의 여정이 시작되고
디티오는 데이터를 포장한 채
레포지토리는 약속을 지키고
뷰모델은 상태를 춤추듯 관리하네
AlarmScreen에 생생한 알림이 떠오르네 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목 '알림 조회 API 연동'은 변경사항의 핵심인 서버 API 연동을 통한 알림 조회 기능을 명확하게 요약합니다.
Linked Issues check ✅ Passed PR의 모든 주요 변경사항(NotificationService API 추가, Repository 구현, ViewModel 추가, AlarmScreen 연동)이 이슈 #17의 '알림 조회 화면에서 알림 정보를 받아오기' 목표를 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 알림 조회 API 연동이라는 핵심 목표와 직접적으로 관련되어 있으며, 범위를 벗어난 작업은 발견되지 않습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/show-notification-api-#17

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt (1)

48-50: ⚠️ Potential issue | 🟡 Minor

내부 요소에 modifier 파라미터 대신 Modifier를 사용하세요.

Compose 베스트 프랙티스에 따르면, 컴포저블에 전달된 modifier 파라미터는 루트 요소에만 적용해야 합니다. 내부 요소에 사용하면 호출자가 전달한 크기나 패딩 등의 제약이 의도치 않게 적용될 수 있습니다.

🔧 수정 제안
                Icon(
                    painterResource(Res.drawable.ic_settings_back),
                    contentDescription = "setting back",
-                   modifier = modifier
+                   modifier = Modifier
                        .size(24.dp)
                        .clickable { onBack() },
                    tint = MediCareCallTheme.colors.black,
                )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`
around lines 48 - 50, AlarmScreen is using the composable parameter `modifier`
on internal elements (e.g., the icon with `.size(24.dp).clickable { onBack()
}`), which can leak caller constraints; change internal usages to the default
`Modifier` instead and reserve the passed-in `modifier` only for the root
container of the composable. Locate the internal element(s) referencing
`modifier` (the clickable back icon/element) and replace them with
`Modifier.size(...).clickable{...}` while keeping `modifier` applied solely to
the top-level layout in `AlarmScreen`.
🧹 Nitpick comments (5)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmViewModel.kt (1)

29-32: printStackTrace() 대신 적절한 로깅 사용 권장

it.printStackTrace()는 프로덕션 환경에서 적절하지 않습니다. 프로젝트에서 사용 중인 Napier 로거를 활용하는 것이 좋습니다.

♻️ 개선 제안
+import io.github.aakira.napier.Napier
+
 `@KoinViewModel`
 class AlarmViewModel(
     // ...
                 .onFailure {
                     _uiState.update { it.copy(errorMessage = "알림을 불러오지 못했습니다.") }
-                    it.printStackTrace()
+                    Napier.e("알림 로드 실패", it)
                 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmViewModel.kt`
around lines 29 - 32, Replace the use of it.printStackTrace() in the onFailure
block with the Napier logger so exceptions are logged properly; specifically,
inside the lambda where _uiState.update { it.copy(errorMessage = "알림을 불러오지
못했습니다.") } is called, remove printStackTrace() and call Napier.e(...) (or the
project's configured Napier instance) to log the throwable with a clear message
and include the throwable parameter so stack/causes are preserved; ensure you
import Napier and keep the existing errorMessage update logic intact.
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmUiState.kt (1)

5-8: 로딩 상태 추가 고려

현재 alarmPageserrorMessage만 있는데, 로딩 중 상태를 표시하기 위한 isLoading: Boolean = false 필드를 추가하면 사용자 경험이 더 좋아질 수 있습니다.

♻️ 선택적 개선 제안
 data class AlarmUiState(
+    val isLoading: Boolean = false,
     val alarmPages: List<NotificationPageResponseDto> = emptyList(),
     val errorMessage: String? = null,
 )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmUiState.kt`
around lines 5 - 8, Add a loading flag to the UI state by adding a new property
isLoading: Boolean = false to the AlarmUiState data class (alongside alarmPages
and errorMessage), then update any places that construct or copy AlarmUiState
(e.g., ViewModel state initializers, copy() calls, and reducers/collectors that
set errorMessage or alarmPages) to set isLoading appropriately during
fetch/start/finish/error flows so the UI can render a loading indicator.
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt (3)

77-101: 주석 처리된 코드를 제거해 주세요.

하드코딩된 예시 AlarmItem들이 주석 처리되어 있습니다. 이전 구현은 버전 관리 시스템에서 확인할 수 있으니, 코드 정리 차원에서 제거하시는 것이 좋겠습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`
around lines 77 - 101, Remove the commented-out hardcoded AlarmItem examples in
AlarmScreen.kt: delete the commented AlarmItem blocks (references: AlarmItem and
AlarmType usages shown in the diff) so the file no longer contains
dead/commented example items; ensure no other logic depends on those commented
stubs and run a quick build to confirm nothing else references the removed
examples.

105-112: Preview 함수가 koinViewModel() 때문에 동작하지 않을 수 있습니다.

AlarmScreenPreviewkoinViewModel()을 사용하는 AlarmScreen을 호출하는데, Preview 환경에서는 Koin이 초기화되지 않아 크래시가 발생할 수 있습니다. Preview용 mock ViewModel을 주입하거나, Preview에서 Koin을 설정하는 방법을 고려해 보세요.

참고로 @Preview 어노테이션도 누락되어 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`
around lines 105 - 112, AlarmScreenPreview calls AlarmScreen which uses
koinViewModel, causing Preview crashes because Koin isn't initialized; add
`@Preview` to AlarmScreenPreview and make the preview provide a safe mock
ViewModel (or initialize a minimal Koin module for preview) so AlarmScreen can
render without runtime Koin. Specifically, modify AlarmScreenPreview to be
annotated with `@Preview` and supply AlarmScreen with a preview-safe ViewModel
instance (or set up Koin in the preview scope) instead of letting AlarmScreen
call koinViewModel() directly.

58-75: 로딩 상태와 빈 목록 상태 처리를 고려해 보세요.

현재 구현에서는:

  1. 데이터 로딩 중일 때 사용자에게 피드백이 없습니다
  2. 알림이 없을 때(alarmPages가 비어있고 에러도 없는 경우) 빈 화면이 표시됩니다

사용자 경험 향상을 위해 로딩 인디케이터와 "알림이 없습니다" 같은 빈 상태 메시지 추가를 권장드립니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`
around lines 58 - 75, The current UI branch only shows errors or iterates
uiState.alarmPages; add handling for loading and empty states: when
uiState.isLoading (or add a Boolean isLoading to the uiState if missing) render
a Loading/Progress composable instead of AlarmItem, and when not loading and
uiState.errorMessage == null and uiState.alarmPages is empty (or all pages have
no notifications) render a clear empty-state composable/message (e.g., "알림이
없습니다") instead of nothing; update AlarmScreen's conditional logic around
uiState.errorMessage and uiState.alarmPages to first check isLoading, then
errorMessage, then empty, then iterate notifications to render AlarmItem with
existing alarmType/content/date logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/fcm/NotificationService.kt`:
- Around line 18-19: The getNotifications() API in NotificationService currently
returns Response<List<NotificationPageResponseDto>> but
NotificationPageResponseDto already models a paginated container (totalPages,
currentPageNumber, currentElements, notifications); change the signature of
suspend fun getNotifications() to return Response<NotificationPageResponseDto>
instead of a List wrapper, and update any call sites or imports that expect the
old List-based type to use the single NotificationPageResponseDto container.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/NotificationRepositoryImpl.kt`:
- Around line 13-19: NotificationRepositoryImpl currently leaves
changeNotificationState(id: String) and testNotification() as TODOs which will
throw NotImplementedError if ever called; implement these methods in
NotificationRepositoryImpl by providing the real business logic (e.g., call the
appropriate data source / API client methods, update local datasource or remote
endpoint, or toggle the notification flag), wrap outcomes in a Result<Unit>
(return Result.success(Unit) on success and Result.failure(exception) on
errors), and ensure you catch and convert exceptions to failures; locate the
methods by name (changeNotificationState and testNotification) in class
NotificationRepositoryImpl and implement them consistent with other repository
methods (using existing network/data-layer helpers and coroutine patterns).

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`:
- Around line 55-57: The inner scrollable Column is using the passed-in
parameter named modifier instead of the Compose root Modifier; update the Column
call that currently sets modifier = modifier.verticalScroll(scrollState) to use
Modifier.verticalScroll(scrollState) so the internal layout doesn't accidentally
inherit external modifiers—look for the Column that applies
verticalScroll(scrollState) and replace the use of the parameter "modifier" with
the top-level "Modifier".

---

Outside diff comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`:
- Around line 48-50: AlarmScreen is using the composable parameter `modifier` on
internal elements (e.g., the icon with `.size(24.dp).clickable { onBack() }`),
which can leak caller constraints; change internal usages to the default
`Modifier` instead and reserve the passed-in `modifier` only for the root
container of the composable. Locate the internal element(s) referencing
`modifier` (the clickable back icon/element) and replace them with
`Modifier.size(...).clickable{...}` while keeping `modifier` applied solely to
the top-level layout in `AlarmScreen`.

---

Nitpick comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`:
- Around line 77-101: Remove the commented-out hardcoded AlarmItem examples in
AlarmScreen.kt: delete the commented AlarmItem blocks (references: AlarmItem and
AlarmType usages shown in the diff) so the file no longer contains
dead/commented example items; ensure no other logic depends on those commented
stubs and run a quick build to confirm nothing else references the removed
examples.
- Around line 105-112: AlarmScreenPreview calls AlarmScreen which uses
koinViewModel, causing Preview crashes because Koin isn't initialized; add
`@Preview` to AlarmScreenPreview and make the preview provide a safe mock
ViewModel (or initialize a minimal Koin module for preview) so AlarmScreen can
render without runtime Koin. Specifically, modify AlarmScreenPreview to be
annotated with `@Preview` and supply AlarmScreen with a preview-safe ViewModel
instance (or set up Koin in the preview scope) instead of letting AlarmScreen
call koinViewModel() directly.
- Around line 58-75: The current UI branch only shows errors or iterates
uiState.alarmPages; add handling for loading and empty states: when
uiState.isLoading (or add a Boolean isLoading to the uiState if missing) render
a Loading/Progress composable instead of AlarmItem, and when not loading and
uiState.errorMessage == null and uiState.alarmPages is empty (or all pages have
no notifications) render a clear empty-state composable/message (e.g., "알림이
없습니다") instead of nothing; update AlarmScreen's conditional logic around
uiState.errorMessage and uiState.alarmPages to first check isLoading, then
errorMessage, then empty, then iterate notifications to render AlarmItem with
existing alarmType/content/date logic.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmUiState.kt`:
- Around line 5-8: Add a loading flag to the UI state by adding a new property
isLoading: Boolean = false to the AlarmUiState data class (alongside alarmPages
and errorMessage), then update any places that construct or copy AlarmUiState
(e.g., ViewModel state initializers, copy() calls, and reducers/collectors that
set errorMessage or alarmPages) to set isLoading appropriately during
fetch/start/finish/error flows so the UI can render a loading indicator.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmViewModel.kt`:
- Around line 29-32: Replace the use of it.printStackTrace() in the onFailure
block with the Napier logger so exceptions are logged properly; specifically,
inside the lambda where _uiState.update { it.copy(errorMessage = "알림을 불러오지
못했습니다.") } is called, remove printStackTrace() and call Napier.e(...) (or the
project's configured Napier instance) to log the throwable with a clear message
and include the throwable parameter so stack/causes are preserved; ensure you
import Napier and keep the existing errorMessage update logic intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fcf7de67-f90d-402b-9090-68b0c86f9a34

📥 Commits

Reviewing files that changed from the base of the PR and between 61088a4 and 6f6501f.

📒 Files selected for processing (9)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/fcm/NotificationService.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/di/ApiModule.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/dto/response/NotificationPageResponseDto.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/dto/response/NotificationResponseDto.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/NotificationRepository.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/NotificationRepositoryImpl.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmUiState.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/viewmodel/AlarmViewModel.kt

Comment on lines +18 to +19
@GET("notifications")
suspend fun getNotifications(): Response<List<NotificationPageResponseDto>>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Ktorfit REST API pagination response type pattern

💡 Result:

Ktorfit does not have a built-in specific "pagination response type pattern" like Retrofit's PagedList or dedicated pagination classes. Instead, pagination is handled by defining custom data classes that match the REST API's paginated response structure (e.g., containing items list, total count, current page, total pages) and using @Query parameters for page/size in the API interface methods. Example pattern from official docs and examples: 1. Define a paginated response data class: @kotlinx.serialization.Serializable data class PaginatedResponse( val data: List, val currentPage: Int, val totalPages: Int, val totalItems: Int ) 2. API interface method with pagination queries: interface ApiService { @GET("items") suspend fun getItems( @Query("page") page: Int, @Query("size") size: Int ): PaginatedResponse } 3. Usage relies on Ktor client's ContentNegotiation (e.g., JSON) for deserialization. Custom ResponseConverter can wrap responses if needed (e.g., for error handling), but standard serialization handles typical paginated JSON. This mirrors Retrofit patterns but leverages Kotlin serialization. No official pagination converter/factory exists in Ktorfit docs (up to v2.7.2, 2026). For infinite lists, combine with Flow via FlowConverterFactory.

Citations:


🏁 Script executed:

# Find the NotificationPageResponseDto definition
find . -type f -name "*.kt" | xargs grep -l "NotificationPageResponseDto" | head -20

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 589


🏁 Script executed:

# Search for the DTO definition in the codebase
rg "data class NotificationPageResponseDto|class NotificationPageResponseDto" -A 10

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 893


🏁 Script executed:

# Check for other Response types in the same file to understand the pattern
rg "Response<" composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/fcm/NotificationService.kt -B 2 -A 2

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 313


🏁 Script executed:

# Look for related pagination or response DTOs
rg "PageResponseDto|PagedResponse|PaginatedResponse" --type kt

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 101


🏁 Script executed:

# Check for other API endpoints to see pagination pattern
rg "@GET" composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api -B 1 -A 3 | head -50

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 5282


🏁 Script executed:

# Look for Response<List patterns in the codebase
rg "Response<List<" composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 1249


🏁 Script executed:

# Verify NoticesResponseDto to confirm the pattern difference
rg "data class NoticesResponseDto" -A 10

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 1636


반환 타입 수정 필요: List<NotificationPageResponseDto>NotificationPageResponseDto

NotificationPageResponseDto는 이미 한 페이지의 알림 데이터를 담는 컨테이너(totalPages, currentPageNumber, currentElements, notifications)인데, Response<List<NotificationPageResponseDto>>로 감싸면 List[Page[items]] 구조가 돼서 안 맞습니다.

다른 API들과 비교하면 개별 항목을 반환할 때만 Response<List<ItemDto>>를 쓰고, 페이지네이션이 있을 때는 Response<PageContainerDto> 패턴을 써야 해요. 여기서는 Response<NotificationPageResponseDto>로 수정하세요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/fcm/NotificationService.kt`
around lines 18 - 19, The getNotifications() API in NotificationService
currently returns Response<List<NotificationPageResponseDto>> but
NotificationPageResponseDto already models a paginated container (totalPages,
currentPageNumber, currentElements, notifications); change the signature of
suspend fun getNotifications() to return Response<NotificationPageResponseDto>
instead of a List wrapper, and update any call sites or imports that expect the
old List-based type to use the single NotificationPageResponseDto container.

Comment on lines +13 to +19
override suspend fun changeNotificationState(id: String): Result<Unit> {
TODO("Not yet implemented")
}

override suspend fun testNotification(): Result<Unit> {
TODO("Not yet implemented")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if TODO methods are called anywhere in the codebase

# Search for changeNotificationState calls
echo "=== changeNotificationState 호출 검색 ==="
rg -n "changeNotificationState" --type=kt

echo ""
echo "=== testNotification 호출 검색 ==="
rg -n "testNotification" --type=kt

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 215


🏁 Script executed:

#!/bin/bash
# Search for changeNotificationState and testNotification calls (corrected syntax)

echo "=== changeNotificationState 호출/정의 검색 ==="
rg "changeNotificationState" --type-add 'kotlin:*.kt' -tkotlin -B2 -A2

echo ""
echo "=== testNotification 호출/정의 검색 ==="
rg "testNotification" --type-add 'kotlin:*.kt' -tkotlin -B2 -A2

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 4057


🏁 Script executed:

#!/bin/bash
# Also search without type restriction
echo "=== changeNotificationState (모든 파일) ==="
rg "changeNotificationState" -B2 -A2

echo ""
echo "=== testNotification (모든 파일) ==="
rg "testNotification" -B2 -A2

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 4055


🏁 Script executed:

#!/bin/bash
# Read the actual file to verify current state
echo "=== NotificationRepositoryImpl.kt 파일 내용 ==="
cat -n "composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/NotificationRepositoryImpl.kt"

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 1188


TODO 메서드들이 현재 호출되지 않아 즉각적인 문제는 없지만, 향후 구현 필요

changeNotificationState()testNotification() 메서드가 TODO()로 남아있고 호출 시 NotImplementedError를 발생시키긴 하지만, 코드베이스 전체를 검색한 결과 이 메서드들은 현재 어느 곳에서도 호출되지 않고 있습니다. 따라서 지금은 런타임 충돌 위험이 없습니다. 다만 인터페이스 계약을 완성하기 위해 언젠가는 반드시 구현되어야 합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/NotificationRepositoryImpl.kt`
around lines 13 - 19, NotificationRepositoryImpl currently leaves
changeNotificationState(id: String) and testNotification() as TODOs which will
throw NotImplementedError if ever called; implement these methods in
NotificationRepositoryImpl by providing the real business logic (e.g., call the
appropriate data source / API client methods, update local datasource or remote
endpoint, or toggle the notification flag), wrap outcomes in a Result<Unit>
(return Result.success(Unit) on success and Result.failure(exception) on
errors), and ensure you catch and convert exceptions to failures; locate the
methods by name (changeNotificationState and testNotification) in class
NotificationRepositoryImpl and implement them consistent with other repository
methods (using existing network/data-layer helpers and coroutine patterns).

Comment on lines +55 to +57
Column(
modifier = modifier.verticalScroll(scrollState),
) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

내부 Column에도 Modifier를 사용하세요.

위와 동일한 이유로, 스크롤 가능한 내부 Column에도 modifier 파라미터 대신 Modifier를 사용해야 합니다.

🔧 수정 제안
        Column(
-           modifier = modifier.verticalScroll(scrollState),
+           modifier = Modifier.verticalScroll(scrollState),
        ) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/alarm/screen/AlarmScreen.kt`
around lines 55 - 57, The inner scrollable Column is using the passed-in
parameter named modifier instead of the Compose root Modifier; update the Column
call that currently sets modifier = modifier.verticalScroll(scrollState) to use
Modifier.verticalScroll(scrollState) so the internal layout doesn't accidentally
inherit external modifiers—look for the Column that applies
verticalScroll(scrollState) and replace the use of the parameter "modifier" with
the top-level "Modifier".

ProtossManse added a commit that referenced this pull request Mar 25, 2026
ProtossManse added a commit that referenced this pull request Mar 25, 2026
Copy link
Copy Markdown
Contributor

@librawish808 librawish808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 알림 조회 API 연동

2 participants